package com.hxzy.tms.service;

import java.util.Date;
import java.util.List;

import com.hxzy.tms.entity.Project;
import com.hxzy.tms.entity.Team;
import com.hxzy.tms.entity.TeamUser;
import com.hxzy.tms.entity.User;

public interface TeamService {
    ServiceResult<Team> read(long id);

    ServiceResult<Team> update(long id, String name, String desc, String intro, String subdomain, Date gmtBegin,
            Date gmtEnd);
    ServiceResult<Team> saveOrUpdate(Long id,String name, String desc, String intro, String subdomain, Date gmtBegin,
            Date gmtEnd);

    ServiceResult<Team> create(String name, String desc, String intro, String subdomain, Date gmtBegin, Date gmtEnd);
    
    List<Team> list(Integer status);

    // 我的团队列表
    ServiceResult<List<Team>> myLists(Long status);

    //分页查询
    List<Team> myTeam(Long uidCreate,int arg1,int arg2);
    
    int count(long uidCreate);
    /**
     * 邀请指定的用户到指定的团队
     * 
     * @param uid
     *            邀请人
     * @param teamId
     *            团队id
     * @param email
     *            被邀请人的邮箱
     * @return 1：加入成功， -1：email 对应的用户不存在 -2: 用户已经加入了该团队
     */
    int invite(long uid, long teamId, String email);
    
    //团队成员列表
    ServiceResult<List<User>> memberList(Long teamId);
    
    //团队项目列表
    ServiceResult<List<Project>> projectList(Long teamId);
    
    //创建团队的用户
    ServiceResult<List<Team>> createUser(Long userId,Integer status); 
    
    //用户加入的团队
    ServiceResult<List<TeamUser>> userJionTeam(Long userId);
    
    
}
